package com.example.myapplication;

import android.app.Activity;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MyCloudDetails  extends Activity {
    private TextView mTextview;
    private TextView time;
    private TextView location;
    private TextView hashCode;
    private int NoteCloudId;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);//Remove notification bar
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);//去除黑框
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_cloud_details);
        mTextview = (TextView)this.findViewById(R.id.Cloud_text);
        hashCode=(TextView)findViewById(R.id.cloudhashCode);
        NoteCloudId=getIntent().getIntExtra("NoteID",0);
        System.out.println(NoteCloudId+"...............................");
        mTextview.setText(getIntent().getStringExtra("Content"));
    }
    public void getCode(View v) {
        int Value = NoteCloudId;
        Value =2*Value+3;
        String Result=Integer.toString(Value)+"512";
        hashCode.setText("授权码是"+Result);
    }
    //    public static String getHashCode(String code) {
//        int Value = Integer.valueOf(code);
//        Value =2*Value+3;
//        String Result=Integer.toString(Value)+"512";
//        return Result;
//    }
//    public static String decodeHashCode(String code){
//        code=code.substring(0,code.length()-3);
////        System.out.println(code);
//        int Value=Integer.valueOf(code);
//        return Integer.toString((Value-3)/2);
//    }
    public void goBackClick(View v) {
        finish();
    }
}
